home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / util / cli / WDelta.lha / WDelta / src / sources / error.i < prev    next >
Encoding:
Text File  |  1999-06-25  |  3.2 KB  |  139 lines

  1.  IFND ERROR_I
  2. ERROR_I=1
  3. ;*---------------------------------------------------------------------------
  4. ;  :Author.    Bert Jahn
  5. ;  :Contens.    macros for error handling
  6. ;  :EMail.    wepl@kagi.com
  7. ;  :Address.    Franz-Liszt-Straße 16, Rudolstadt, 07404, Germany
  8. ;  :Version.    $Id: error.i 1.4 1999/06/24 23:13:31 jah Exp jah $
  9. ;  :History.    30.12.95 separated from WRip.asm
  10. ;        18.01.96 IFD Label replaced by IFD Symbol
  11. ;             because Barfly optimize problems
  12. ;        17.01.99 _PrintError* optimized
  13. ;  :Requires.    -
  14. ;  :Copyright.    This program is free software; you can redistribute it and/or
  15. ;        modify it under the terms of the GNU General Public License
  16. ;        as published by the Free Software Foundation; either version 2
  17. ;        of the License, or (at your option) any later version.
  18. ;        This program is distributed in the hope that it will be useful,
  19. ;        but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. ;        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. ;        GNU General Public License for more details.
  22. ;        You can find the full GNU GPL online at: http://www.gnu.org
  23. ;  :Language.    68000 Assembler
  24. ;  :Translator.    Barfly V1.130
  25. ;---------------------------------------------------------------------------*
  26. *##
  27. *##    error.i
  28. *##
  29. *##    _PrintError    subsystem(d0) error(a0) operation(a1)
  30. *##    _PrintErrorDOS    operation(a0)
  31. *##    _PrintErrorTD    error(d0.b) operation(a0)
  32.  
  33.     dc.b    "$Id: error.i 1.4 1999/06/24 23:13:31 jah Exp jah $"
  34.     EVEN
  35.  
  36.         IFND    DOSIO_I
  37.             INCLUDE    dosio.i
  38.         ENDC
  39.         IFND    STRINGS_I
  40.             INCLUDE    strings.i
  41.         ENDC
  42.         IFND    DEVICES_I
  43.             INCLUDE    devices.i
  44.         ENDC
  45.  
  46. ;----------------------------------------
  47. ; Ausgabe eines Fehlers
  48. ; Übergabe :    D0 = CPTR Subsystem | NIL
  49. ;        A0 = CPTR Art des Fehlers | NIL
  50. ;        A1 = CPTR bei Operation | NIL
  51. ; Rückgabe :    -
  52.  
  53. PrintError    MACRO
  54.     IFND    PRINTERROR
  55. PRINTERROR = 1
  56.         IFND    PRINTARGS
  57.             PrintArgs
  58.         ENDC
  59.  
  60. _PrintError    movem.l    d0/a1,-(a7)
  61.         move.l    a0,-(a7)
  62.         lea    (.txt),a0
  63.         move.l    a7,a1
  64.         bsr    _PrintArgs
  65.         add.w    #12,a7
  66.         rts
  67.         
  68. .txt        dc.b    155,"1m%s",155,"22m (%s/%s)",10,0
  69.         EVEN
  70.     ENDC
  71.         ENDM
  72.  
  73. ;----------------------------------------
  74. ; Ausgabe eines DOS-Fehlers
  75. ; Übergabe :    A0 = CPTR Operation die zu Fehler führte | NIL
  76. ; Rückgabe :    -
  77.  
  78. PrintErrorDOS    MACRO
  79.     IFND    PRINTERRORDOS
  80. PRINTERRORDOS = 1
  81.         IFND    PRINTERROR
  82.             PrintError
  83.         ENDC
  84.  
  85. _PrintErrorDOS    movem.l    d2-d4/a0/a6,-(a7)
  86.         move.l    (gl_dosbase,GL),a6
  87.         jsr    (_LVOIoErr,a6)
  88.         move.l    d0,d1            ;code
  89.         moveq    #0,d2            ;header
  90.         moveq    #64,d4            ;buffer length
  91.         sub.l    d4,a7
  92.         move.l    a7,d3            ;buffer
  93.         jsr    (_LVOFault,a6)
  94.         lea    (_dosname),a0
  95.         move.l    a0,d0            ;subsystem
  96.         move.l    a7,a0            ;error
  97.         move.l    (12,a7,d4.l),a1        ;operation
  98.         bsr    _PrintError
  99.         add.l    d4,a7
  100.         movem.l    (a7)+,d2-d4/a0/a6
  101.         rts
  102.     ENDC
  103.         ENDM
  104.  
  105. ;----------------------------------------
  106. ; Ausgabe eines Trackdisk Errors
  107. ; Übergabe :    D0 = BYTE errcode
  108. ;        A0 = CPTR Operation | NIL
  109. ; Rückgabe :    -
  110.  
  111. PrintErrorTD    MACRO
  112.     IFND    PRINTERRORTD
  113. PRINTERRORTD=1
  114.         IFND    DOSTRING
  115.             DoString
  116.         ENDC
  117.         IFND    PRINTERROR
  118.             PrintError
  119.         ENDC
  120.  
  121. _PrintErrorTD    move.l    a0,-(a7)
  122.         ext.w    d0
  123.         lea    (_trackdiskerrors),a0
  124.         bsr    _DoString
  125.         move.l    d0,a0            ;error
  126.         lea    (.devaccess),a1
  127.         move.l    a1,d0            ;subsystem
  128.         move.l    (a7)+,a1        ;operation
  129.         bra    _PrintError
  130.  
  131. .devaccess    dc.b    'device access',0
  132.         EVEN
  133.         IFND    TRACKDISKERRORS
  134.             trackdiskerrors
  135.         ENDC
  136.     ENDC
  137.         ENDM
  138.  ENDC
  139.